-
-
Notifications
You must be signed in to change notification settings - Fork 33.9k
gh-143089: Fix ParamSpec default examples to use list instead of tuple #143179
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gh-143089: Fix ParamSpec default examples to use list instead of tuple #143179
Conversation
|
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
sobolevn
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's another case of default=() in test_paramspec, please fix it as well.
Misc/NEWS.d/next/Documentation/2025-12-25-19-49-03.gh-issue-143089._vbPkt.rst
Outdated
Show resolved
Hide resolved
7844a4a to
df4cf50
Compare
|
Actually why didn't you update the test? |
|
I originally updated the test, but reverted it after CI showed that the runtime default is still expected to be a tuple. So only the docs/examples now use list syntax. |
|
Mmmh, should we actually enforce it at runtime then? maybe as a follow-up PR? cc @JelleZijlstra |
|
That sounds good — I’d be happy to help with a follow-up PR if needed |
|
Thanks @VanshAgarwal24036 for the PR, and @JelleZijlstra for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14. |
…f tuple (pythonGH-143179) (cherry picked from commit 67d3d03) Co-authored-by: VanshAgarwal24036 <[email protected]>
…f tuple (pythonGH-143179) (cherry picked from commit 67d3d03) Co-authored-by: VanshAgarwal24036 <[email protected]>
|
GH-143538 is a backport of this pull request to the 3.14 branch. |
|
GH-143539 is a backport of this pull request to the 3.13 branch. |
…of tuple (GH-143179) (#143538) Co-authored-by: VanshAgarwal24036 <[email protected]>
…of tuple (GH-143179) (#143539) Co-authored-by: VanshAgarwal24036 <[email protected]>
This PR fixes incorrect ParamSpec default examples in the ParamSpec
docstring shown by help(ParamSpec).
According to the typing specification, ParamSpec defaults must be a list
literal, ellipsis (
...), or another ParamSpec. Tuples are not permitted.The docstring examples previously used tuple defaults. These are updated
to use list defaults to match the typing specification and the existing
documentation.
Closes: gh-143089